Some more resilience to errors in creating vbds etc; still needs more work
authorshand@ubuntu.eng.hq.xensource.com <shand@ubuntu.eng.hq.xensource.com>
Tue, 13 Sep 2005 18:03:04 +0000 (10:03 -0800)
committershand@ubuntu.eng.hq.xensource.com <shand@ubuntu.eng.hq.xensource.com>
Tue, 13 Sep 2005 18:03:04 +0000 (10:03 -0800)
to tidy up things properly (e.g. the store state).

Signed-off-by: Steven Hand <steven@xensource.com>
linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c

index 17760646ab44be1a30bdff44bda461a195ffa76d..bf9817a8f087e1a63e63094578330b158828c2f4 100644 (file)
@@ -170,6 +170,7 @@ static void backend_changed(struct xenbus_watch *watch, const char *node)
 
                be->blkif = alloc_blkif(be->frontend_id);
                if (IS_ERR(be->blkif)) {
+                        /* XXX SMH: should free blkif here... hmm */
                        err = PTR_ERR(be->blkif);
                        be->blkif = NULL;
                        xenbus_dev_error(dev, err, "creating block interface");
@@ -178,6 +179,8 @@ static void backend_changed(struct xenbus_watch *watch, const char *node)
 
                err = vbd_create(be->blkif, handle, be->pdev, be->readonly);
                if (err) {
+                        /* XXX SMH: should free blkif here too... */
+                        be->blkif = NULL; 
                        xenbus_dev_error(dev, err, "creating vbd structure");
                        return;
                }